package gamefw.tests;

import gamefw.framework.Coordinate;
import gamefw.gameplugin.AbstractPlayer;
import gamefw.gameplugin.GameEntity;
import gamefw.tests.implementations.game.SimpleGameEntity;
import gamefw.tests.implementations.game.SimplePlayer;
import gamefw.tests.implementations.ui.SimpleVisualEntity;
import gamefw.uiplugin.IVisualResource;
import junit.framework.TestCase;

public class TestGameEntity extends TestCase {

	/*
	 * GN01
	 * Test to check if game entities creation and association with 
	 * visual resources, player and positions works correctly. 
	 */
	public void testGameEntity () {
		GameEntity ge = new SimpleGameEntity();
		
		IVisualResource ve = new SimpleVisualEntity();
		ge.setVisualEntity(ve);
		assertSame(ve, ge.getVisualResource());
		
		AbstractPlayer player = new SimplePlayer();
		ge.setOwner(player);
		assertSame(player, ge.getOwner());
		
		ge.setPosition(new Coordinate(0,0));
		assertEquals(ge.getPosition().getX(), 0);
		assertEquals(ge.getPosition().getY(), 0);
	}
}
